#include <stdio.h>

int main()
{
    int N, i;
    scanf("%d", &N);
    printf("Gnomes:\n");
    for (i = 0; i < N; i++)
    {
        int a, b, c;
        scanf("%d %d %d", &a, &b, &c);
        if ((a - b) * (b - c) > 0)
            printf("Ordered\n");
        else
            printf("Unordered\n");
    }
    return 0;
}
